<template>
	<view class="page">
		<topVue :title="$t('充值明细')"></topVue>
		<view class="thVue flex-between align-center margin20 padding-row20">
			<view>{{ $t('时间') }}</view>
			<view>{{ $t('金额') }}</view>
		</view>
		<view class="tdVue flex-between align-center margin0 padding-row20" v-for="(item, index) in list" :key="index">
			<view>{{ item.createTime }}</view>
			<view>{{ item.amount }}USDT</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				pageNum: 1,
				pageSize: 10,
				list: [],
				isLastPage: false
			}
		},

		async onLoad() {
			await this.getList()
		},

		onReachBottom() {
			if(this.isLastPage) return
			this.pageNum++
			this.getList()
		},
		methods: {
			async getList(){
				const res = await this.$request("/front/user/rechargeRecord", {
					pageNum: this.pageNum,
					pageSize: this.pageSize
				})
				if(res.code===0) {
					this.list = this.list.concat(res.data.list)
					this.isLastPage = res.data.isLastPage
				}
			}
		}
	}
</script>

<style lang="less" scoped>
	.thVue {
		width: 690rpx;
		height: 60rpx;
		background: #D7E3FD;
		border-radius: 4rpx;
		view {
			font-size: 24rpx;
			color: #8C929F;
		}
	}
	.tdVue {
		width: 690rpx;
		height: 60rpx;
		background: #FAFCFF;
		border-radius: 4rpx;
		view {
			font-size: 24rpx;
			color: #666666;
		}
	}
</style>
